
#import "UIView+Pyw.h"

@implementation UIView (Pyw)

- (void)setX:(CGFloat)x {
    CGRect tmpFrame = self.frame;
    tmpFrame.origin.x = x;
    self.frame = tmpFrame;
}

- (CGFloat)x {
    return self.frame.origin.x;
}

- (void)setY:(CGFloat)y {
    CGRect tmpFrame = self.frame;
    tmpFrame.origin.y = y;
    self.frame = tmpFrame;
}

- (CGFloat)y {
    return self.frame.origin.y;
}

- (void)setWidth:(CGFloat)width {
    CGRect tmpFrame = self.frame;
    tmpFrame.size.width = width;
    self.frame = tmpFrame;
}

- (CGFloat)width {
    return self.frame.size.width;
}

- (void)setHeight:(CGFloat)height {
    CGRect tmpFrame = self.frame;
    tmpFrame.size.height = height;
    self.frame = tmpFrame;
}

- (CGFloat)height {
    return self.frame.size.height;
}

- (void)setCenterX:(CGFloat)centerX {
    CGPoint point = self.center;
    point.y = centerX;
    self.center = point;
}

- (CGFloat)centerX {
    return self.center.x;
}

- (void)setCenterY:(CGFloat)centerY {
    CGPoint point = self.center;
    point.y = centerY;
    self.center = point;
}

- (CGFloat)centerY {
    return self.center.y;
}

- (void)setSize:(CGSize)size {
    CGRect tmpFrame = self.frame;
    tmpFrame.size.height = size.height;
    tmpFrame.size.width = size.width;
    self.frame = tmpFrame;
}

- (CGSize)size {
    return self.frame.size;
}

@end
